import {useEffect, useState} from "react";

 function useLocalStorage(key, defaultValue){
    const [message,setMessage]=useState(defaultValue);
    useEffect(()=>{
          localStorage.setItem(key,message);
          // setMessage()
    },[message])
    return [message,setMessage];
}
export {useLocalStorage}

